<?php
/**
 * Created by PhpStorm.
 * User: yangsen
 * Date: 15/7/1
 * Time: 下午8:46
 */

ini_set('date.timezone','Asia/Shanghai');
error_reporting(E_ERROR);

require_once "./lib/WxPay.Api.php";
require_once './lib/WxPay.Notify.php';
require_once './lib/log.php';
/**
 * Created by PhpStorm.
 * User: yangsen
 * Date: 15/6/29
 * Time: 下午6:00
 */
$logHandler= new CLogFileHandler("logs/".date('Y-m-d').'.log');
$log = Log::Init($logHandler, 15);
class TestLib {
    protected $CI;
    public function __construct() {
         $this->CI =&get_instance();
        $this->CI->load->helper('url');
         $this->CI->load->database();
    }

    public function getData() {

        Log::DEBUG('121212');
        $data = $this->CI->db->query('select * from t_user');
        $error  = $this->CI->db->error();
        var_dump($error);
//        if (!$data) {
//            $error  = $this->CI->db->error();
//            var_dump($error);
//        }
        return $data->result();
    }

}